package com.xh.audit.api.forest.wps;

import cn.hutool.json.JSONObject;
import com.dtflys.forest.annotation.*;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.xh.audit.api.forest.wps.req.WpsTemplateFileReq;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Address(source = WpsInfo.WpsAddressSource.class)
public interface WpsInterface {

    /**
     * 获取文件模板信息
     *
     * @param randomTime
     * @return
     */
    @Request(
            url = "/extend/api/templateFile/queryByPage",
            type = "post",
            dataType = "json"//返回类型
    )
    ObjectNode templateFileQueryByPage(//@Header("x-user-token") String Token,
                                       @JSONBody WpsTemplateFileReq randomTime);


    /**
     * 保存文件模板信息
     *
     * @param Token
     * @param randomTime
     * @return
     */
    @Request(
            url = "/extend/api/templateFile/save",
            type = "post",
            dataType = "json",//返回类型
            contentType = "multipart/form-data"
    )
    JSONObject templateFileSave(@Header("x-user-token") String Token,
                                @Body WpsTemplateFileReq randomTime,
                                @DataFile(value = "file") MultipartFile file);

    @Request(
            url = "/extend/api/templateFile/del",
            type = "post",
            dataType = "json"//返回类型

    )
    JSONObject templateFileDel(@Header("x-user-token") String Token,
                               @JSONBody List<Integer> ids);


}